<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="com.example.softwareconfigurationcoursedesign.Product" %>
<%@ page import="java.util.List" %>
<!DOCTYPE html>
<html>
<head>
    <title>搜索结果</title>
</head>
<body>
<h1>搜索结果</h1>
<% List<Product> productList = (List<Product>) request.getAttribute("productList");
    if (productList != null && !productList.isEmpty()) { %>
<table>
    <tr>
        <th>商品PID</th>
        <th>商品ID</th>
        <th>商品名称</th>
        <th>商品价格</th>
        <th>商品标签</th>
        <th>商品图片</th>
        <!-- Add more table headers for other product attributes -->
    </tr>
    <% for (Product product : productList) { %>
    <tr>
        <td><%= product.getId() %></td>
        <td><%= product.getPid() %></td>
        <td><%= product.getPname() %></td>
        <td><%= product.getPprice() %></td>
        <td><%= product.getPtag() %></td>
        <td><img src="<%= product.getPurl() %>" alt="<%= product.getPname() %>" class="product_img"></td>
        <!-- Display other product attributes as needed -->
    </tr>
    <% } %>
</table>
<% } else {
    out.println("<p>No products found.</p>");
}
%>
</body>
</html>
